<template>
<div class="cart-list">
      <scroll class="content" ref="scroll">
          <!-- <li v-for="(item,index) in cartList" :key="index" >{{item}}</li> -->
          <cart-list-item v-for="(item,index) in cartList" :key="index" :itemInfo="item" />
      </scroll>
</div>
  
</template>


<script>

import {mapGetters} from 'vuex'
import Scroll from 'components/common/scroll/Scroll.vue'
import CartListItem from './CartListItem.vue'
export default {
  components: { Scroll ,CartListItem },
    name:'CartList',
    computed:{
        ...mapGetters(['cartList'])
    },
    activated(){
        // console.log('sss');
        //让scroll进行一次刷新，不刷新的话新添加的数据scroll获取不到就不能滚动了
        this.$refs.scroll.refresh()
    }

}
</script>

<style scoped>
.content{   

    /* height: calc(100% - 44px -49px); */
    height: 100%;
    overflow: hidden;
}
.cart-list{
    height: calc(100% - 44px - 49px - 40px);
}

</style>